package com.controller;



import com.entity.*;
import com.mybatisflex.core.query.QueryWrapper;
import com.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Controller
public class liangController {
    @Autowired
    private BJbxxService bJbxxService;
    @Autowired
    private BJbzpxsService bJbzpxsService;
    @GetMapping(value = "/liang")
    public  String index(Model model){
        try{
            QueryWrapper wrapper = QueryWrapper.create();
            List<BJbxx> BZpxslist = bJbxxService.getMapper().selectListByQuery(wrapper);
            BJbzpxs bJbzpxs = bJbzpxsService.queryChain().one();
            model.addAttribute("bJbzpxs",bJbzpxs);
            model.addAttribute("BZpxslist",BZpxslist);
        } catch (Exception e){
            e.printStackTrace();
        }
        return "client/index";
    }
}
